home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWResour / Include / SLResSin.xh < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.8 KB  |  173 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLResSin.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:                SLResSin.h
  14.  *     Release Version:    $ ODF 1 $
  15.  * 
  16.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  17.  * 
  18.  * 
  19.  */
  20.  
  21.  
  22. #ifndef SOM_FW_OResourceSink_xh
  23. #define SOM_FW_OResourceSink_xh
  24.  
  25. class FW_OResourceSink;
  26.  
  27. #define FW_OResourceSink_MajorVersion 1
  28. #define FW_OResourceSink_MinorVersion 0
  29.  
  30. /*
  31.  * Passthru lines: File: "C.xh", "before"
  32.  */
  33.  
  34.  
  35. /* C++ SOM defs */
  36. #include <somcls.xh>
  37. #include <somcm.xh>
  38.  
  39. /* C++ parent defs */
  40. #ifndef SOM_FW_ORandomAccessSink_xh
  41. #include <SLRanSin.xh>
  42. #endif
  43.  
  44. #ifndef FW_OResourceSink_API
  45. #define FW_OResourceSink_API
  46. /*
  47.  * -- The Class API
  48.  */
  49.  
  50. /*
  51.  * Start of user-defined types:
  52.  */
  53. class SOMClass;
  54. class SOMObject;
  55. class FW_OSink;
  56. class FW_ORandomAccessSink;
  57. class FW_OResourceSink;
  58. class FW_OResource;
  59.  
  60. /*
  61.  * End of user-defined types.
  62.  */
  63.  
  64. #ifdef OLDIBMSOMAPISUPPORT
  65. #define FW_OResourceSinkCClassData FW_OResourceSinkClassData
  66. #define FW_OResourceSinkNewClass(major,minor) somNewVersionedClassReference(FW_OResourceSink,major,minor)
  67. #endif
  68.  
  69. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  70. #define FW_OResourceSinkMetaClass SOMClass
  71.  
  72. #if PRAGMA_ALIGN_SUPPORTED
  73. #  pragma options align=power
  74. #endif
  75.  
  76. /* The API to the FW_OResourceSink class object, and the methods it introduces. */
  77. SOMEXTERN struct FW_OResourceSinkClassDataStructure {
  78. #ifdef OLDIBMSOMAPISUPPORT
  79.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  80. #else
  81.     long zero;
  82. #endif
  83.     somStaticClassInfo *sci;
  84.     somDToken        instanceDataToken;
  85.     long reserved [3];
  86.     somMToken InitFromOResource;
  87. } SOMDLINK FW_OResourceSinkClassData;
  88.  
  89. #if PRAGMA_ALIGN_SUPPORTED
  90. #  pragma options align=reset
  91. #endif
  92.  
  93. #if !defined(FW_OResourceSink_Class_Source) && !defined(SOM_Module_slressin_Source)
  94. #if PRAGMA_IMPORT_SUPPORTED
  95. #pragma import list FW_OResourceSinkClassData
  96. #endif
  97. #endif
  98.  
  99.  
  100. /*
  101.  * -- Typedefs and inline method declarations for left path inherited methods
  102.  * -- are omitted because this compilation had -museinheritedmethods in effect
  103.  */
  104.  
  105.  
  106. /*
  107.  * -- Typedefs for FW_OResourceSink Method Procedures
  108.  */
  109. SOMEXTERN {
  110. typedef void   (* SOMLINK somTD_FW_OResourceSink_InitFromOResource)(FW_OResourceSink *somSelf, Environment *ev,
  111.         FW_OResource* theResource);
  112. }
  113.  
  114. #endif /* FW_OResourceSink_API */
  115.  
  116.  
  117. /*
  118.  * -- This emitter treats Method Tokens as Thunks by default.
  119.  * -- Use the sc modifier "nothunks" to change this default
  120.  */
  121. #undef somresolve_
  122. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  123.  
  124. /*
  125.  * -- The C++ Wrapper Class for FW_OResourceSink
  126.  */
  127. class FW_OResourceSink : public FW_ORandomAccessSink
  128. {
  129. public:
  130.  
  131. // FW_OResourceSink::new registers use of the class object, and then uses somNew
  132. // to allocate memory and load the object method table pointer. 
  133. void *operator new(size_t size)
  134. {
  135.     SOM_IgnoreWarning(size);
  136.     // Allocate memory using the default allocator for FW_OResourceSink, and
  137.     // clear mem & set method table pointer, call basic initialization
  138. #ifdef SOMCHKNULL
  139.     void * __somResult = (void *)
  140.       somNewObject(FW_OResourceSink);
  141.     SOMCHKNULL(__somResult);
  142.     return __somResult;
  143. #else
  144.     return (void*) somNewObject(FW_OResourceSink);
  145. #endif
  146. }
  147.  
  148. // FW_OResourceSink::delete uses the default deallocator for the object's class.
  149. void operator delete(void * obj)
  150. {
  151.     if (obj) {
  152.         SOM_Resolve(obj,SOMObject,somFree)
  153.            ( (SOMObject*) obj );
  154.     }
  155. }
  156.  
  157. /* method: InitFromOResource */
  158. void   InitFromOResource(Environment *ev,
  159.         FW_OResource* theResource)
  160. {
  161.    SOM_ResolveD(this,FW_OResourceSink,FW_OResourceSink,InitFromOResource)
  162.     (this,ev,theResource);
  163. #ifdef SOMCHKEXCEPT
  164.       SOMCHKEXCEPT;
  165. #endif
  166. }
  167.  
  168. };   /* FW_OResourceSink */
  169.  
  170.  
  171.  
  172. #endif       /* SOM_FW_OResourceSink_xh */
  173.